﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;
using Boggle;

namespace Web.Models
{
    public class BoggleTraversalViewModel
    {
        public IEnumerable<BoggleCellViewModel> VisitedCells { get; set; }
        public String Word { get; set; }
    }

    public class BoggleTraversalViewModelProfile : Profile
    {
        protected override void Configure()
        {
            base.Configure();
            Mapper.CreateMap<BoggleTraversal, BoggleTraversalViewModel>()
                .ForMember(viewModel => viewModel.Word, opt => opt.MapFrom(traversal => traversal.ToString()))
                .ForMember(viewModel => viewModel.VisitedCells, opt => opt.MapFrom(traversal => traversal));
        }
    }
}